package com.robot.controller;


import com.robot.common.result.Response;
import com.robot.dao.dto.RoleDto;
import com.robot.dao.dto.UserDTO;
import com.robot.dao.vo.CompanyVO;
import com.robot.service.CompanyService;
import com.robot.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/manager")
@Slf4j
@Api(tags = "管理员操作")
public class ManagerController{

    @Autowired
    private RoleService roleService;

    @Autowired
    private CompanyService companyService;

    //添加角色
    @PostMapping("/addRole")
    @ApiOperation("新增角色")
    public Response addByInvitationCode(@RequestBody RoleDto roleDto) {
        roleService.insertRole(roleDto);
        return Response.success();
    }



    @PostMapping("/createCompany")
    @ApiOperation("创建公司并指定公司规模")
    public Response<CompanyVO> pageCompanyUserList(@RequestBody UserDTO userDTO) {
        CompanyVO companyVO=companyService.createCompany(userDTO);
        return Response.success(companyVO);
    }






}
